#include <func.h>

int main()
{
    int fds[2];
    pipe(fds);
    if (!fork())
    {
        close(fds[0]);
        write(fds[1], "hello", 5);
    } else {
        close(fds[1]);
        char buf[20] = {0};
        read(fds[0], buf, sizeof(buf));
        printf("I am parent, get = %s\n", buf);
    }
    return 0;
}